package com.smart.service.push;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Map;


@Data
@Accessors(chain = true)
public class PushBody {


    //	推送平台设置
    private String platform;

    //推送设备指定
    private Audience audience;
    private Notification notification;
    private String message;
    private SmsMessage smsMessage;
    private Map<String, Object> options;
    private Callback callback;
    private String cid;

    // Getters and Setters 略
    @Data
    @Accessors(chain = true)
    public static class Audience {
        private List<String> registration_id;
    }
    @Data
    @Accessors(chain = true)
    public static class Notification {
        private String alert;
        private Android android;
        private Ios ios;
        private Voip voip;
        private QuickApp quickapp;

        @Data
        @Accessors(chain = true)
        public static class Android {
            private String alert;
            private String title;
            private int builder_id;
            private String large_icon;
            private Intent intent;
            private Map<String, Object> extras;

            @Data
            public static class Intent {
                private String url;

            }
        }
        @Data
        @Accessors(chain = true)
        public static class Ios {
            private String alert;
            private String sound;
            private String badge;
            private String thread_id;
            private Map<String, Object> extras;

            // Getters and Setters 略
        }
        @Data
        public static class Voip {
            private Map<String, Object> voipMap;

            // Getters and Setters 略
        }
        @Data
        @Accessors(chain = true)
        public static class QuickApp {
            private String alert;
            private String title;
            private String page;

            // Getters and Setters 略
        }
    }
    @Data
    @Accessors(chain = true)
    public static class SmsMessage {
        private int temp_id;
        private Map<String, String> temp_para;
        private int delay_time;
        private boolean active_filter;
    }

    @Data
    @Accessors(chain = true)
    public static class Callback {
        private String url;
        private Map<String, Object> params;
        private int type;

    }
}
